requireJS(['constant', 'site', 'handlebars'], function (constant, site, Handlebars) {
    function AliOss() {
        // 阿里云接口
        site.send({
            url: 'manager/selectAliOss.do',
            //async:false
            callback: function (data) {
                var list = JSON.parse(data);
                $("#access_id_input").val(list.content.ACCESS_ID)
                $("#access_key_input").val(list.content.ACCESS_KEY)
                $("#callback_url_input").val(list.content.CALLBACK_URL)

                $("#endpoint_input").val(list.content.ENDPOINT)
                $("#host_input").val(list.content.HOST)
                $("#id_input").val(list.content.id)


            }
        })
    }

    AliOss();
    // 修改阿里云
    $("#aliyun_submit").click(function () {

        site.send({
            url: 'manager/updateAliOss.do',
            //async:false
            data: {
                ACCESS_ID: $("#access_id_input").val(),
                ACCESS_KEY: $("#access_key_input").val(),
                ENDPOINT: $("#endpoint_input").val(),
                HOST: $("#host_input").val(),
                CALLBACK_URL: $("#callback_url_input").val(),
                id: $("#id_input").val()
            },
            callback: function (data) {
                var list = JSON.parse(data);
                if (list.type == '1') {
                    AliOss();
                    constant.fn.Message('T', list.msg);
                } else {
                    constant.fn.Message('F', list.msg);
                }
            }
        })
    })

})